//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.neurosky.thinkgear;

import java.util.Arrays;

public class Matlab {
    public Matlab() {
    }

    public static int[] sortIndices(float[] var0, float[] var1) {
        int[] var2 = new int[var0.length];

        for(int var3 = 0; var3 < var0.length; ++var3) {
            for(int var4 = 0; var4 < var0.length; ++var4) {
                if(var0[var3] == var1[var4]) {
                    var2[var4] = var3;
                    break;
                }
            }
        }

        return var2;
    }

    public static float[] linspace(float var0, float var1, int var2) {
        float[] var3 = new float[var2];

        for(int var4 = 0; var4 < var2; ++var4) {
            var3[var4] = var0 + (var1 - var0) / (float)(var2 - 1) * (float)var4;
        }

        return var3;
    }

    public static int[] linspace(int var0, int var1, int var2) {
        float[] var4;
        int[] var5 = new int[(var4 = linspace((float)var0, (float)var1, var2)).length];

        for(int var3 = 0; var3 < var2; ++var3) {
            var5[var3] = Math.round(var4[var3]);
        }

        return var5;
    }

    public static int[] setdiff(int[] var0, int[] var1) {
        int[] var2 = new int[var0.length];
        var1 = (int[])var1.clone();
        int var3 = 0;
        Arrays.sort(var1);

        for(int var4 = 0; var4 < var0.length; ++var4) {
            var2[var4] = Arrays.binarySearch(var1, var0[var4]);
            if(var2[var4] >= 0) {
                ++var3;
            }
        }

        int[] var6 = new int[var0.length - var3];
        int var5 = 0;

        for(var3 = 0; var3 < var0.length; ++var3) {
            if(var2[var3] < 0) {
                var6[var5++] = var0[var3];
            }
        }

        return var6;
    }

    public static void disp(float[][] var0) {
        for(int var1 = 0; var1 < var0.length; ++var1) {
            for(int var2 = 0; var2 < var0[0].length; ++var2) {
                System.out.format("\t%3.2f", new Object[]{Float.valueOf(var0[var1][var2])});
            }

            System.out.println("");
        }

    }

    public static void disp(float[] var0) {
        for(int var1 = 0; var1 < var0.length; ++var1) {
            System.out.format("\t%3.2f", new Object[]{Float.valueOf(var0[var1])});
        }

        System.out.println("");
    }

    public static void disp(int[][] var0) {
        for(int var1 = 0; var1 < var0.length; ++var1) {
            for(int var2 = 0; var2 < var0[0].length; ++var2) {
                System.out.format("\t%d", new Object[]{Integer.valueOf(var0[var1][var2])});
            }

            System.out.println("");
        }

    }

    public static void disp(int[] var0) {
        for(int var1 = 0; var1 < var0.length; ++var1) {
            System.out.format("\t%d", new Object[]{Integer.valueOf(var0[var1])});
        }

        System.out.println("");
    }
}
